﻿<%namespace YouHP.Model%>
<%namespace YouHP.Utility%>
<%template _header%>

<script type="text/javascript">
	function checkCheckBox(form,objtag)
	{
		if (typeof(objtag.checked) == "undefined")
		{
			objtag.checked = true;
		}
		for(var i = 0; i < form.elements.length; i++) 
		{
			var e = form.elements[i];
			if(e.name == "itemid") 
			{
				e.checked = objtag.checked;
			}
		}
		objtag.checked = !objtag.checked;
	}
	function SubmitForm(actiontype)
	{
	    _$('actiontype').value = actiontype;
	    _$('dataform').submit();
	}
</script>

<div class="layout-cols2">
	  <%if IsPost%>
			<%template _msgbox%>
		<%else%>
	    <div class="box">
	        <div class="caption">
	            好友申请 
	        </div>
	        <div class="content">
          <%if FriendDataList.Count==0%>
            <h1>暂无好友申请</h1>
            <%else%>
	            <form id="dataform" name="dataform" method="post">
	                <input type="hidden" name="state" value="{State}"/>
	                <input type="hidden" id="actiontype" name="actiontype" value="1"/>
	            <div style="text-align:center;">    
	            <table class="tablestyle">

	                <thead><tr>
	                    <th width="10%">选择</th>
	                    <th width="25%">用户名</th>
	                    <th width="40%">申请信息</th>
	                    <th width="25%">申请时间</th>
	                </tr></thead>
	                <tbody>
	                    <%csharp%>
	                    foreach(UserInfo item in FriendDataList)
	                    {
	                    <%/csharp%>
	                    <tr>
	                        <td><input name="itemid" id="id{item.Id}" type="checkbox" value="{item.Id}" /></td>
	                        <%csharp%>TempUrl = "/Profile/Index.aspx?uid=" + item.Id;<%/csharp%>
	                        <td><a href="{this.GetUrl(TempUrl)}">{item.UserName}</a></td>
	                        <td><%if item.ApplyMsg!=""%>{item.ApplyMsg}<%else%>无<%/if%></td>	                        
                            <td>{item.ApplyFriendTime}</td>	  
                    
	                    </tr>
	                    <%csharp%> } <%/csharp%>

	                </tbody>
	                <tfoot><tr><th>&nbsp;</th><th>&nbsp;</th><th>&nbsp;</th><th align=right><div class="pages">{PagingString}</div></th></tr></tfoot>
	            </table>
                </div>
				<p class="friendapply">

					    <span  onmouseout="this.className='new_bt'" onmouseover="this.className='new_bt_h'" onclick="checkCheckBox(_$('dataform'),this)" class="new_bt">全选/全不选</span>
					    <span  onmouseout="this.className='new_sbt'" onmouseover="this.className='new_sbt_h'" onclick="SubmitForm('2');" class="new_sbt">同意</span>
					    <span  onmouseout="this.className='new_sbt'" onmouseover="this.className='new_sbt_h'" onclick="SubmitForm('3');" class="new_sbt">拒绝</span>
				</p>	
			    </form>
	        <%/if%>   
	        </div>
	    </div>
	    
	    <%/if%>
	
	
</div>

<%template _footer%>